package com.itheima.advance.reflect.demo03;

import java.io.File;
import java.lang.reflect.Field;

public class ReflectDemo01 {

    public static void main(String[] args) throws Exception {

        Class<?> studentClass = Class.forName("com.itheima.advance.reflect.demo03.Student");

        Field[] fields = studentClass.getFields();
        for(Field field : fields){
            System.out.println(field);
        }

        Field[] declaredFields = studentClass.getDeclaredFields();
        for(Field field : declaredFields){
            System.out.println(field);
        }

        Field field = studentClass.getField("name");
        System.out.println(field);

        Field declaredField = studentClass.getDeclaredField("age");
        System.out.println(declaredField);
    }
}
